var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2pvzChannel = require("pvzChannel");
var $2DataManager = require("DataManager");
var $2MyUtils = require("MyUtils");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_SpIcon = /* */function (_cc$Component68) {
  babel_inherits(c, _cc$Component68);
  var _super84 = babel_createSuper(c);
  function c() {
    var _this196;
    babel_classCallCheck(this, c);
    _this196 = _super84.apply(this, arguments);
    _this196.spine = null;
    _this196.video = null;
    _this196.type = 0;
    _this196.scene = null;
    return _this196;
  }
  babel_createClass(c, [{
    key: "show",
    value: function show(e, t, a, n, l) {
      this.node.x = e;
      this.node.y = t;
      this.node.zIndex = 999;
      this.node.parent = n.sunParent;
      this.scene = n;
      this.type = l;
      var r = $2MyUtils.MyUtils.getRandomInt(-1, 2);
      var _c = 0 === l ? "FX5_1" : "FX5_2";
      this.spine.setAnimation(0, _c, true);
      var d = cc.tween;
      var h = this;
      d(h.node).parallel(d().by(.25, {
        x: 50 * r
      }), d().by(.25, {
        y: 50
      }).to((t + 30 - $2DataManager.default.instance.groudYArr[a]) / 200, {
        y: $2DataManager.default.instance.groudYArr[a] - 30
      })).call(function () {
        h.scheduleOnce(function () {
          h.node.destroy();
        }, 10);
        h.node.on(cc.Node.EventType.TOUCH_END, h.onClick, h);
      }).start();
      if ($2pvzChannel.pvzChannel.instance().channel.indexOf("wx") >= 0 && $2pvzChannel.pvzChannel.instance().getCtrl("p7")) {
        this.video.active = false;
      } else {
        this.video.active = true;
      }
    }
  }, {
    key: "onClick",
    value: function onClick() {
      if (0 === this.type) {
        this.scene.onClickAddGold();
      } else {
        this.scene.onClickBomb();
      }
      this.node.destroy();
    }
  }, {
    key: "onDisable",
    value: function onDisable() {
      cc.Tween.stopAllByTarget(this.node);
    }
  }]);
  return c;
}(cc.Component);
cc__decorate([ccp_property(sp.Skeleton)], def_SpIcon.prototype, "spine", undefined);
cc__decorate([ccp_property(cc.Node)], def_SpIcon.prototype, "video", undefined);
def_SpIcon = cc__decorate([ccp_ccclass], def_SpIcon);
exports.default = def_SpIcon;